package com.xy.mvvmdemo.bean

/**
 * @ClassName UserBean
 * @Author xy
 * @Date 2021/7/9 11:51
 * @Description TODO
 */
data class UserBean (
    private var  name:String = "小王",
    private var  age:Int = 17,
    private var isMan:String = "未成年"
){
    fun isChild():String{
        if (age<18){
            isMan = "未成年"
        }else{
            isMan = "已成年"
        }
        return isMan
    }


    private fun isChild(age :Int):String{
        return if (age<18){
             "$age+岁未成年"
        }else{
            "$age+岁已成年"
        }
    }
}